using Microsoft.AspNetCore.Mvc;
using ConsoleApi.Models;
using ConsoleApi.Services.Logins;
using MESData.ErrorCode;

namespace ConsoleApi.Controllers;

[ApiController]
[Route("api/[controller]")]
public class ConsoleApiController : ControllerBase
{
    private readonly IAuthService _authService;

    public ConsoleApiController(IAuthService authService)
    {
        _authService = authService;
    }

    [HttpPost("login")]
    public async Task<ApiResult<LoginResponseDto>> Login([FromBody] LoginDto login)
    {
        return await _authService.Login(login);
    }
} 